<% @page_title = @user.display_name -%>

<% content_for :right do %>
<% if admin? %>
<% form_for :user, :url => admin_user_path(@user), :html => {:class => "xdialog"} do |f| -%>
  <h6><%= _('Admin &amp; Moderation') %></h6>

  <% if @user.forums.any? -%>

	<p><%= _('This user can moderate the following forums.  Click one to remove.') %></p>

  <ul class="flat">
  <% @user.forums.find(:all, :select => 'forums.*, moderatorships.id as moderatorship_id').each do |forum| -%>
    <li>
      <%#= link_to forum.name, forum_path(forum), :class => "hidden" %>
      <%#= link_to 'remove', moderator_path(@user, forum.moderatorship_id), :method => :delete %>
			<%= link_to forum.name, moderator_path(@user, forum.moderatorship_id), :method => :delete, :confirm => "#{_('Remove user as moderator for')} #{forum.name}?" %>
    </li>
  <% end -%>
  </ul>
  <% end -%>

  <p>
	<label><%= _('Add as moderator') %></label><br />
	<select name="moderator">
    <option value="-"></option>
    <%= options_from_collection_for_select(Forum.find(:all, :order => 'position') - @user.forums, "id", "name") %>
  </select></p>

  <p><label><%= f.check_box :admin %> <%= _('User is an administrator') %></label></p>

  <p><%= submit_tag :Save %></p>
<% end -%>
<% end -%>
<% end %>

<p style="float:right;"><%= avatar_for @user, 80 %></p> 

<h1><%=h @user.display_name %> </h1>

<p class="subtitle">
  <%= feed_icon_tag @user.display_name, formatted_user_posts_path(:user_id => @user, :format => :rss) %>
  <span>
    <%= "#{@user.topics.count}"+ _('topic') %>,
    <%= "#{@user.posts_count}"+ _('post') %>
    (view <%= link_to "all", user_posts_path(@user) %> | 
    <%= link_to _('monitored'), monitored_posts_path(@user) %> <%= _('posts') %>)<br />
  </span>
</p>

<%= @user.bio_html %>

<% unless @user.website.blank? -%>
<p><strong><%= _('Website:') %></strong> <%= white_list link_to(@user.website.gsub("http://",""), "http://" + @user.website.gsub("http://","")) %>
<% end -%>
<p><%= _('User since') %> <%= @user.created_at.to_date.to_s :long %></p>

